package com.vito.dcs.sys.transportVehicle.service.impl;

import java.util.*;
import org.springframework.beans.factory.annotation.*;

import com.vito.dcs.sys.transportVehicle.model.SysTransportVehicleModel;
import com.vito.dcs.sys.transportVehicle.service.SysTransportVehicleService;
import com.alibaba.dubbo.config.annotation.Service;
import com.vito.dcs.sys.transportVehicle.dao.SysTransportVehicleMapper;
import com.vito.base.model.DataGrid;
import com.vito.base.factory.IDFactory;

/**
 * SysTransportVehicleService接口实现类
 * @author  Feng J. E-mail: 
 * @version 0.1.1
 * @date    2019-3-28 11:41:15
 */
@Service
public class SysTransportVehicleServiceImpl implements SysTransportVehicleService {
	
	@Autowired
	private SysTransportVehicleMapper systransportvehicleMapper;
	
	@Override
	public void saveSysTransportVehicle(SysTransportVehicleModel systransportvehicle){
		  systransportvehicle.setId(IDFactory.getIDFactory().getIdInc()+"");           
		systransportvehicleMapper.saveSysTransportVehicle(systransportvehicle);
	}
	@Override
	public DataGrid<SysTransportVehicleModel> querySysTransportVehicleByPage(SysTransportVehicleModel systransportvehicle){
		DataGrid<SysTransportVehicleModel> dg = new DataGrid<SysTransportVehicleModel>();
		dg.setRows(systransportvehicleMapper.querySysTransportVehicleByPage(systransportvehicle));
		dg.setTotal(systransportvehicle.getTotal());
		return dg;
	}
	@Override
	public SysTransportVehicleModel querySysTransportVehicle(SysTransportVehicleModel systransportvehicle){
		return systransportvehicleMapper.querySysTransportVehicle(systransportvehicle);
	}
	@Override
	public SysTransportVehicleModel updateSysTransportVehicle(SysTransportVehicleModel systransportvehicle){
		if(systransportvehicleMapper.updateSysTransportVehicle(systransportvehicle)>0){
			return systransportvehicle;
		}else{
			return null;
		}
	}
	
	@Override
	public Integer deleteSysTransportVehicle(SysTransportVehicleModel systransportvehicle){
		return systransportvehicleMapper.deleteSysTransportVehicle(systransportvehicle);
	}

}